/*
 *    Document   : StReproducaoMaterialList
 *    Created on : 04/03/2013, 16:22:40
 *    Author     : Fiúza <rbfiuza@gmail.com>
 */



Ext.define('FC.view.StReproducaoMaterialList' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.stReproducaoMaterialList',
    columnLines: true,     
//    title : '   ',
    store : 'StReproducaoMaterial',
    plugins: [
    Ext.create('Ext.grid.plugin.CellEditing', {clicksToEdit: 1})
    ],
    selModel: {
        selType: 'cellmodel'
    },
    width: 1200,
        features: [{
            ftype: 'summary'
    }],
//    height: 300,
    initComponent: function() {
        
        this.columns = [
    {
        header: 'id',
        dataIndex: 'id', 
        sortable: false,
        hideable: false,
        hidden:true
    }
    ,{
        header: 'StReproducaoMaterial', 
        dataIndex: 'dscStReproducaoMaterial',
        sortable: false,
        hideable: false,
        flex: 1
        ,summaryRenderer: function(value, summaryData, dataIndex) {
//                return  'TOTAL DE REPRODUÇÃO DO MATERIAL DIDATICO APROVADO';
                  return  'TOTAL APROVADO';
                //((value === 0 || value > 1) ? '(' + value + ' Tasks)' : '(1 Task)');
        }
    }
    ,{
        text:'Quantidades',
        sortable: false,
        hideable: false,
        columns:[
            {
                header: 'Alunos',
                dataIndex: 'qntAlunos', 
                flex: 1,
                sortable: false,
                hideable: false,
                editor: {
                    allowBlank: false 
                }
            }
            ,{
                header: 'Tutores',
                dataIndex: 'qntTutores', 
                flex: 1,
                sortable: false,
                hideable: false,
                editor: {
                    allowBlank: false
                }
            }
            
            ,{
                header: 'Polos',
                dataIndex: 'qntPolos', 
                flex: 1,
                sortable: false,
                hideable: false,
                editor: {
                    allowBlank: false
                }
            }

            ,{
                header: 'Prof',
                dataIndex: 'qntProf', 
                flex: 1,
                sortable: false,
                hideable: false,
                editor: {
                    allowBlank: false
                }
            }
        ]
    }

    ,{
        header: 'Exemp. por Disciplina',
        dataIndex: 'qntExemplarDisc', 
        flex: 1,
        sortable: false,
        hideable: false
    }
    
    ,{
        header: 'Quantidade Disciplina',
        dataIndex: 'qntDisciplinas', 
        flex: 1,
        sortable: false,
        hideable: false
    }    

    ,{
        header: 'Quantidade Total',
        dataIndex: 'qntTotal', 
        flex: 1,
        sortable: false,
        hideable: false
    }

    ,{
        header: 'Valor Unitário',
        dataIndex: 'vlrUnit', 
        flex: 1,
        sortable: false,
        hideable: false,
        xtype: 'numbercolumn', 
        format:'0.00',
        editor: {
            allowBlank: false
        }
    }                     
    ,{
        header: 'Valor Final',
        dataIndex: 'vlrFinal', 
        flex: 1,
        sortable: false,
        hideable: false,
        xtype: 'numbercolumn', 
        format:'0.00',
        summaryType: 'sum',
        summaryRenderer: function(v) {
                return  Ext.util.Format.number(v, '0.00');
            }
    }
    ,{
        header: 'Indicações e/ou Parâmetros',
        dataIndex: 'indicacoesParametros', 
        sortable: false,
        hideable: false,
        flex: 1,
        editor:{
            allowBlank: false
        }
    }
];
 
this.callParent(arguments);
},
   
formatDate: function(value){
    return value ? Ext.Date.dateFormat(value, 'd M, Y') : '';
}
});